CREATE TABLE [dbo].[sv_disc]
(
[ik_disc] [int] NOT NULL,
[ik_grp_disc] [int] NOT NULL,
[ik_ckl_disc] [int] NOT NULL,
[ik_podckl] [int] NULL,
[cname_ckl_disc1] [varchar] (20) COLLATE Cyrillic_General_CI_AS NULL,
[ik_uch_plan] [int] NOT NULL,
[Uchet] [bit] NULL,
[iHour_gos] [int] NULL,
[ik_disc_uch_plan] [int] NOT NULL IDENTITY(1, 1),
[ik_default_kaf] [int] NULL,
[iIndivid] [int] NULL,
[ViborGroup] [int] NOT NULL CONSTRAINT [DF__sv_disc__ViborGr__571DF1D5] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[sv_disc] ADD CONSTRAINT [PK_sv_disc] PRIMARY KEY CLUSTERED  ([ik_disc_uch_plan]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[sv_disc] ADD CONSTRAINT [IX_sv_disc] UNIQUE NONCLUSTERED  ([ik_disc], [ik_uch_plan]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[sv_disc] WITH NOCHECK ADD CONSTRAINT [FK_sv_disc_discpln] FOREIGN KEY ([ik_disc]) REFERENCES [dbo].[discpln] ([iK_disc]) ON UPDATE CASCADE
GO
ALTER TABLE [dbo].[sv_disc] WITH NOCHECK ADD CONSTRAINT [FK_sv_disc_Uch_pl] FOREIGN KEY ([ik_uch_plan]) REFERENCES [dbo].[Uch_pl] ([ik_uch_plan]) ON DELETE CASCADE ON UPDATE CASCADE
GO
